import { getLevelZeroJson } from '@/utils';
import { ManageCommonAPI } from '@/pages/type';

/* 获取数据字典搜索数组 loadMdicMapList: Record<string, any>, areaListData: any[]*/
const getSearchList = (): ManageCommonAPI.ISearchList => {
  const orgDeptList = getLevelZeroJson();

  return [
    {
      name: 'fullName',
      placeholder: '单位名称',
      label: '单位名称',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'enterpriseType',
      placeholder: '企业属性',
      label: '企业属性',
      componentType: 'Select',
      allowClear: true,
      dataSource: [
        { name: '大陆', id: 0, value: 0 },
        { name: '港澳台', id: 1, value: 1 },
        { name: '境外', id: 2, value: 2 },
      ],
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'legalName',
      placeholder: '法定人代表',
      label: '法定人代表',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },

    {
      name: 'searchCreditID',
      placeholder: '统一社会信用代码',
      label: '统一社会信用代码',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'contactName',
      placeholder: '首要联系人',
      label: '首要联系人',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },
    {
      name: 'contactMobile',
      placeholder: '首要联系人电话',
      label: '首要联系人电话',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: false,
    },

    // =============高级搜索==============
    {
      name: 'workAddress',
      placeholder: '单位地址',
      label: '单位地址',
      componentType: 'Input',
      allowClear: true,
      md: 4,
      sm: 24,
      whetherSenior: true,
    },
    {
      name: 'registerAddress',
      placeholder: '所属区域',
      label: '所属区域',
      componentType: 'Input',
      // dataSource: areaListData,
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: true,
    },
    {
      name: 'bankName',
      placeholder: '开户行名称',
      label: '开户行名称',
      componentType: 'Input',
      allowClear: true,
      md: 8,
      sm: 24,
      whetherSenior: true,
    },
    {
      name: 'bankAccount',
      placeholder: '开户行账号',
      label: '开户行账号',
      componentType: 'Input',
      allowClear: true,
      md: 8,
      sm: 24,
      whetherSenior: true,
    },
    {
      name: 'applyFormName',
      placeholder: '创建',
      label: '创建',
      componentType: 'DeptAndUser',
      dataSource: orgDeptList,
      allowClear: true,
      md: 6,
      sm: 24,
      whetherSenior: true,
      formOrgType: {
        COMP: 'createCompanyID',
        DEPT: 'createDepartmentID',
        POS: 'createPositionID',
        USER: 'createrID',
      }, //获取组织机构表单name, componentType: 'DeptAndUser', 必传
    },

    {
      name: 'createTime',
      placeholder: '创建',
      label: '创建时间',
      componentType: 'RangePicker',
      md: 8,
      sm: 24,
      whetherSenior: true,
      /**控制 日期范围检索 , 不传则为全部显示,*/
      // showRange: { today: true, week: true, month: false, year: false }
    },
  ];
};

export { getSearchList };
